<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	   <link rel="stylesheet" href="{$Think.config.Style}/css/ch-ui.admin.css">
    <link rel="stylesheet" href="{$Think.config.Style}/font/css/font-awesome.min.css">
    <script type="text/javascript" src="{$Think.config.Style}/js/jquery.min.js"></script>
    <script type="text/javascript" src="{$Think.config.Style}/js/ch-ui.admin.js"></script>
    <script type="text/javascript" src="{$Think.config.Style}/layer/layer.js"></script>
</head>
<body>
    {include file="public/breadcrumb"/}

	<!--结果页快捷搜索框 开始-->
	<!-- <div class="search_wrap">
        <form action="" method="post">
            <table class="search_tab">
                <tr>
                    <th width="120">选择分类:</th>
                    <td>
                        <select onchange="javascript:location.href=this.value;">
                            <option value="">全部</option>
                            <option value="http://www.baidu.com">百度</option>
                            <option value="http://www.sina.com">新浪</option>
                        </select>
                    </td>
                    <th width="70">关键字:</th>
                    <td><input type="text" name="keywords" placeholder="关键字"></td>
                    <td><input type="submit" name="sub" value="查询"></td>
                </tr>
            </table>
        </form>
    </div> -->
    <!--结果页快捷搜索框 结束-->

    <!--搜索结果页面 列表 开始-->
   
        <div class="result_wrap">
            <!--快捷导航 开始-->
            <div class="result_content">
                <div class="short_wrap">
                    <a href="{:url('back/groupdata/add')}"><i class="fa fa-plus"></i>新增用户组</a>
 
                </div>
            </div>
            <!--快捷导航 结束-->
        </div>

        <div class="result_wrap">
            <div class="result_content">
                <table class="list_tab">
                    <tr>
                        <th class="tc">ID</th>
                        <th class="tc">角色名称</th>
                        <th class="tc">用户数量</th>
                        <th class="tc">操作</th>
                    </tr>
                    
                {volist name="lists" id="list"}
                    <tr>
                        <td class="tc">{$list.id}</td>
                        <td class="tc">
                            {$list.title}
                        </td>
                        <td class="tc">{$list.user_count}</td>
                       
                        <td class="tc">
                        <a  href="{:url('back/groupdata/edit',['id'=>$list['id']])}">编辑</a>
                        <a  onclick="delfunc(this)"data-url="{:url('back/groupdata/destroy')}"data-id="{$list.id}">删除</a>
                        </td>
                    </tr>
                {/volist}
                </table>

<div class="page_nav">
{$pages}
</div>

            </div>
        </div>
   
    <!--搜索结果页面 列表 结束-->
<script type="text/javascript">
  function delfunc(obj){
      layer.confirm('确认删除？', {
          btn: ['确定','取消'] //按钮
        }, function(){
            // 确定
          $.ajax({
            type : 'post',
            url : $(obj).attr('data-url'),
            data : {id:$(obj).attr('data-id')},
            dataType : 'json',
            success : function(data){
              if(data.status==1){
                layer.msg(data.msg, {icon: 6,time: 2000});
                $(obj).parent().parent().remove();
              }else{
                layer.msg('操作失败', {icon: 2,time: 2000});
              }
//              layer.closeAll();
            }
          })
        }, function(index){
          layer.close(index);
          return false;// 取消
        }
      );
    }  


</script>


</body>
</html>